<template>
    <div class="app">
        <el-upload class="upload-demo" :multiple="multiple" :accept="accept" :show-file-list="showFileList"
            action="https://test.fancivision.com/voice/uploadVoice/cheakTask" :on-change="handleChange"
            :on-success="uploadSuccess" :file-list="fileList">
            <el-button size="small" type="primary">点击上传</el-button>
            <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div> -->
        </el-upload>
    </div>
</template>
<script>
import wx from 'weixin-js-sdk'
console.log(wx);
export default {
    name: 'UploadAudio',
    data() {
        return {
            fileList: [],
            multiple: false,
            showFileList: false,
            accept: ".mp3, .wav, .flac, .aac, .m4a"
        };
    },
    methods: {
        handleChange(file, fileList) {
            this.fileList = fileList.slice(-3);
        },
        uploadSuccess(response, file, fileList) {
            console.log('response', response);
            console.log('file', file);
            console.log('fileList', fileList);
        }
    }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped></style>